package ua.kharkov.khpi.tarasenko.bach.core.user;

import java.io.Serializable;

/**
 * User's entity with main information which stores in he's session.
 * 
 * @author oleksandr
 * 
 */
public class UserBean implements Serializable {
	private static final long serialVersionUID = 403765462566645630L;

	private int userId;
	private String userFirstName;
	private Role userRole;
	private ShoppingCart shoppingCart = new ShoppingCart();
	
	
	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public String getUserFirstName() {
		return userFirstName;
	}

	public void setUserFirstName(String userFirstName) {
		this.userFirstName = userFirstName;
	}

	public Role getUserRole() {
		return userRole;
	}

	public void setUserRole(Role userRole) {
		this.userRole = userRole;
	}
	
	public ShoppingCart getShoppingCart() {
		return shoppingCart;
	}

	public void setShoppingCart(ShoppingCart shoppingCart) {
		this.shoppingCart = shoppingCart;
	}
	
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("\n");
		builder.append("User's id = ");
		builder.append(userId);
		builder.append("\n\t");
		builder.append("User's first name = ");
		builder.append(userFirstName);
		builder.append("\n\t");
		builder.append("User's role = ");
		builder.append(userRole);
		builder.append("\n");
		return builder.toString();
	}
}
